//
//  {{ClassSourceModel.class_name}}.h
//  {{ClassSourceModel.description}}
//  Ctrip_Wireless_4.0
//
//  Created by gideon qiu
//

#import "{{ClassSourceModel.class_name}}.h"
#import "CTAnnotationModel.h"
{% for import_class in ClassSourceModel.import_class_list -%}
{{import_class}}
{% endfor %}
@implementation {{ClassSourceModel.class_name}}
{% for field_model in ClassSourceModel.field_list -%}
{% if field_model.field_name=="description" -%}
@synthesize {{field_model.field_name}};
{%- endif %}
{%- endfor %}

-(id)init{
	self = [super init];
	if(self){
		self.realServiceCode = @"{{ClassSourceModel.service_code}}";
		{% for field_model in ClassSourceModel.field_list -%}
		self.{{field_model.field_name}} = {{field_model.default_value}};
		{% endfor %}
	}
	return self;
}

-(NSMutableArray *)getAnnotationArray{
	NSMutableArray *array = [NSMutableArray array];
	CTAnnotationModel *model = nil;
    {% for field_model in ClassSourceModel.field_list -%}
    //index:{{field_model.index}} name:{{field_model.field_name}} {{field_model.field_description}}
	model = [[CTAnnotationModel alloc] initWithType:FLAG_{{field_model.serialize_type}} Length:0 FieldName:@"{{field_model.field_name}}" ParserType:@"{{field_model.parser_type}}" EnumArrayValue:@"{{field_model.enum_array_value}}" Require:{% if field_model.require=="Y" %}YES{% else %}NO{% endif %} FieldParmType:@"{{field_model.field_parm_type}}" ServerType:@"{{field_model.server_type}}" Format:@"{{field_model.format}}" ];
	[array addObject:model];
    {% endfor %}
    return array;
}

{% if ClassSourceModel.hasListProperty -%}
+ (NSDictionary *)modelContainerPropertyGenericClass
{
    return @{
    {% for field_model in ClassSourceModel.field_list -%}
    {%- if field_model.parser_type=="List" -%}
        @"{{field_model.field_name}}": {{field_model.field_parm_type}}.class,
    {%- endif -%}
    {% endfor %}
    };
}
{%- endif %}
@end
